<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>列表</title>
    <script src="../../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <!-- 遍历数据 -->
        <ul>
            <li v-for="(p,index) in persons" :key="index">
                {{p.name}}-{{p.age}}
            </li>
        </ul>
        <!-- 遍历对象 -->
        <ul>
            <li v-for="(v,k) in cars" :key="k">
                {{k}}-{{v}}
            </li>
        </ul>
        
    </div>
    

    <script>
        Vue.config.productionTip = false;
        new Vue({
            el: '#root',
            data: {
                persons: [
                    {id:'001',name:"arlei",age:32},
                    {id:'002',name:"connieqi",age:35},
                    {id:'003',name:"anna",age:5}
                ],
                cars:{
                    name:'小安',
                    price:"130000",
                    color:'炫影灰'
                }
            }
        })
    </script>

</body>
</html>